#include <bits/stdc++.h>
using namespace std;
stack<bool> s;
int main(){
    char ch=' ';
    while (ch!='@'){
        cin>>ch;
        if (ch=='(')
        {
            s.push(1);
        }
        if (ch==')')
        {
            if (s.empty())
            {
                cout<<"NO";
                return 0;
            }
            else
            {
                s.pop();
            }
            
            
        }
        
    }
    if (s.empty())
    {
        cout<<"YES";
    }
    else
    {
        cout<<"NO";
    }
    
    
    return 0;
}